package com.nidu.demo.oauth2.dto;

import com.nidu.demo.base.BaseCmd;
import com.nidu.demo.common.constants.Constants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;

@Data
@Schema(description = "OAuth2客户端新增对象")
@EqualsAndHashCode(callSuper = true)
public class OAuth2ClientAddCmd extends BaseCmd {

    /**
     * 客户端编码
     */
    @NotNull(message = "客户端编码不能为空")
    @Schema(description = "客户端编码", example = "xxxx")
    private String clientCode;

    /**
     * 客户端编号
     */
    @NotNull(message = "客户端密钥不能为空")
    @Schema(description = "客户端密钥", example = "xxxx")
    private String clientSecret;

    /**
     * 授权范围
     */
    @Schema(description = "授权范围", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxxx")
    private String scopes;


    /**
     * 重定向 URI
     */
    @NotNull(message = "重定向URI")
    @Schema(description = "重定向URI", example = "xxxx")
    private String redirectUri;

    /**
     * 访问令牌的有效期
     */
    @Schema(description = "访问令牌的有效期", example = "86400")
    private Long accessTokenValiditySeconds = Constants.DEFAULT_AUTH_ACCESS_TOKEN_EXPIRE_SECOND;

    /**
     * 刷新令牌的有效期
     */
    @Schema(description = "刷新令牌的有效期", example = "86400")
    private Long refreshTokenValiditySeconds = Constants.DEFAULT_AUTH_REFRESH_TOKEN_EXPIRE_SECOND;

    /**
     * 刷新令牌的有效期
     */
    @Schema(description = "用户授权有效期", example = "86400")
    private Long approveValiditySeconds = Constants.DEFAULT_AUTH_REFRESH_TOKEN_EXPIRE_SECOND;
}
